package com.finals.function.app;

import android.content.Context;
import android.content.SharedPreferences;

public class BaseConfig {

	String SP_NAME = "SPName";

	BaseApplication mApp;

	public BaseConfig(BaseApplication mApp) {
		this.mApp = mApp;
	}

	int WindowMode = 1;

	public int getWindowMode() {
		putInt("WindowMode", WindowMode);
		return WindowMode;
	}

	public void setWindowMode(int windowMode) {
		WindowMode = getInt("WindowMode", windowMode);
		WindowMode = windowMode;
	}

	public void putInt(String key, int value) {
		SharedPreferences mPreferences = mApp.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
		mPreferences.edit().putInt(key, value).commit();
	}

	public int getInt(String key, int defaults) {
		SharedPreferences mPreferences = mApp.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
		defaults = mPreferences.getInt(key, defaults);
		return defaults;
	}
}
